<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePlansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('plans', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->index()->comment('标题');
            $table->string('cover')->default('')->comment('封面');
            $table->bigInteger('user_id')->unsigned()->default(0)->index()->comment('用户id');
            $table->tinyInteger('status')->unsigned()->default(1)->comment('状态');
            $table->string('description')->default('')->comment('简介');
            $table->timestamp('date')->index()->comment('拍摄时间');
            $table->string('address')->comment('拍摄地点');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('plans');
    }
}
